/*
 * Created on 2005-6-23
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.linkage.util.exception;

import com.linkage.util.log.Logger;

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
@SuppressWarnings("serial")
public class UIException extends BaseException {
	public UIException(){
		
	}
	public UIException(Exception e) {
		if(e instanceof BaseException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UILEVEL);
			setDetailMessage(UIERRORINFO);
			log = Logger.getLogger();
			printErrorStackTrace(log,e);
//			log.error(e.getStackTrace().toString());
		}
	}
	public UIException(Exception e, String className) {
		if(e instanceof BaseException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UILEVEL);
			setDetailMessage(UIERRORINFO);
			log = Logger.getLogger(className);
			printErrorStackTrace(log,e);
//			log.error(e.getStackTrace().toString());
		}
	}
	public UIException(Exception e, Class<?> c) {
		if(e instanceof BaseException){
			this.setSuperException((BaseException)e);
		}else{
			setException(e);
			setErrorLevel(UILEVEL);
			setDetailMessage(UIERRORINFO);
			log = Logger.getLogger(c);
			printErrorStackTrace(log,e);
//			log.error(e.getStackTrace().toString());
		}
	}
}
